package com.tangdi.test;

import java.awt.print.PrinterJob;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.printing.PDFPrintable;

public class ddddd {
	  public static void main(String[] args) throws Exception {  
		 InputStream in = new FileInputStream("C:\\Users\\yang\\Desktop\\杨有威提交的出差费用报销单202005011520000024229(1).pdf");
		 FileOutputStream fos = new FileOutputStream("C:\\Users\\yang\\Desktop\\杨有威提交的出差费用报销单202005011520000024229(4).pdf");
         byte[] b = new byte[1024];
         int len = 0;
         while((len = in.read(b)) != -1){
        	 fos.write(b,0,len);
         }
         fos.flush();
         fos.close();
         in.close();
		 /*PDDocument document = PDDocument.load(in); 
          // 加载成打印文件
           PDFPrintable printable = new PDFPrintable(document);
           PrinterJob job = PrinterJob.getPrinterJob();
           job.setPrintable(printable);
           job.print();*/
	   }  
}
